class CoordinateBancarie < ActiveRecord::Base
  acts_as_paranoid unless SHOW_DELETED
  belongs_to :coordinate_bancarie_ref, :polymorphic => true
  belongs_to :banca, :class_name => 'Partner'#, :foreign_key => 'banca_id' 
  validates_presence_of :iban
  validates_length_of :iban, :is => 27, :allow_nil => true
  validates_format_of :iban, :with => /^([a-zA-Z]{2})([0-9]{2})([a-zA-Z0-9]{4})([0-9]{7})([a-zA-Z0-9]{12})$/
  def name
    iban
  end
end
